//
//  IpxzlFJLCFHomeRequestPfjhYJ.m
//  Dvjf_ios
//
//  Created by Ji on 2018/9/11.
//  Copyright © 2018年 ski. All rights reserved.
//

#import "IpxzlFJLCFHomeRequestPfjhYJ.h"
#import "JLCFHttpManager.h"
#import "vjTtGlJLCFHomeIndexModelBZOjBh.h"

#define HOME_URL                                                    QTZ_REQUEST_URL(@"borrow/appindex")
#define MSG_URL                                                     QTZ_REQUEST_URL(@"user/show/msgs/auth")
#define HOME_ACTIVITY_URL                                           QTZ_REQUEST_URL(@"activity/imagesCenter")
#define HOME_SERVICE                                                QTZ_REQUEST_URL(@"user/about")


@implementation IpxzlFJLCFHomeRequestPfjhYJ

+ (void)postHomeDataWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(mCELYoJLCFHomeIndexDataModelsAqBSs *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:HOME_URL params:params loadingInView:view success:^(NSDictionary *result) {


        vjTtGlJLCFHomeIndexModelBZOjBh *data = [[vjTtGlJLCFHomeIndexModelBZOjBh alloc] initWithDictionary:result error:nil];
        if ([data.code isEqualToString:@"200"]) {
            if (success) {
                success(data.data);
            }
        } else {
            if (failure) {
                failure(data.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)msgCenterDataWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(oXlSXWJLCFHomeMsgCenterResultModeluMXJKS *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:MSG_URL params:params loadingInView:view success:^(NSDictionary *result) {
        
        oXlSXWJLCFHomeMsgCenterResultModeluMXJKS *data = [[oXlSXWJLCFHomeMsgCenterResultModeluMXJKS alloc] initWithDictionary:result error:nil];
        if ([data.code isEqualToString:@"200"]) {
            if (success) {
                success(data);
            }
        } else {
            if (failure) {
                failure(data.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

+ (void)postHomeActivityDataWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(jpWEYNJLCFHomeActivityResultModelpfIuTR *))success failure:(void (^)(NSString *))failure
{
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:HOME_ACTIVITY_URL params:params loadingInView:view success:^(NSDictionary *result) {

        

        jpWEYNJLCFHomeActivityResultModelpfIuTR *activity = [[jpWEYNJLCFHomeActivityResultModelpfIuTR alloc] initWithDictionary:result error:nil];
        if ([activity.code isEqualToString:@"200"]) {
            if (success) {
                success(activity);
            }
        } else {
            if (failure) {
                failure(activity.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}
+ (void)postServiceWithParams:(NSDictionary *)params loadingInView:(UIView *)view success:(void (^)(cwcQCAJLCFHomeServiceDataModelQnsgio *))success failure:(void (^)(NSString *))failure {
    
    [[JLCFHttpManager sharedManager] postDataWithUrl:HOME_SERVICE params:params loadingInView:view success:^(NSDictionary *result) {
        
        TXOYWiJLCFHomeServiceResultModelaNIPQe *data = [[TXOYWiJLCFHomeServiceResultModelaNIPQe alloc] initWithDictionary:result error:nil];
        if ([data.code isEqualToString:@"200"]) {
            if (success) {
                success(data.data);
            }
        } else {
            if (failure) {
                failure(data.msg);
            }
        }
        
    } failure:^(NSString *status) {
        if (failure) {
            failure(status);
        }
    }];
    
}

@end
